import {loginApi} from '@/api/user'
import request from '@/utils/request'
const state = {
  token: null
}
const mutations = {
  setToken(state, token) {
    state.token = token
  },
  removeToken(state) {
    state.token = null
  }
}
const actions = {
  async loginAciotns({commit},data){
    const res = await loginApi(data)
    console.log(res);
    commit('setToken',res.token)
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
